package com.lg.algorithm.collections.queue;

import java.util.ArrayDeque;
import java.util.concurrent.ConcurrentLinkedDeque;

/**
 * 开始多大
 * 16
 *
 * 是否可以扩容
 * 可以，初始化默认为16。指定大小，数组最小会初始化为8。扩容每次乘2，最大为integer.max
 *
 * arrayDeque.getLast();
 *      没有  还出   NoSuchElementException
 */
public class ArrayDequeTest {
    public static void main(String[] args) {
//        LinkedList<Object> objects = new LinkedList<>();
        ArrayDeque<Object> objects1 = new ArrayDeque<>(1);
        objects1.add(1);
        objects1.addFirst(1);
        objects1.addLast(1);
        objects1.remove(1);
        objects1.removeFirst();
        objects1.removeLast();


        System.out.println(Long.MAX_VALUE);
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MAX_VALUE << 1);
        ConcurrentLinkedDeque<Object> objects2 = new ConcurrentLinkedDeque<>();
    }
}
